package com.chengzhi;

import feign.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * ${DESCRIPTION}
 *
 * @param
 * @author RCZ
 * @create 2018-01-10 21:22
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableCircuitBreaker
public class FeignApplication {
    public static void main(String args[]) {
        SpringApplication.run(FeignApplication.class, args);
    }

    /**
     * feign的日志级别
     *  NONE 不记录日志
     *  BASIC 仅记录请求方法 url以及响应
     *  HEADERS 记录BASIC 以及请求响应的头信息
     *  FULL 记录所有的请求和响应明细 包括头信息 请求体 元数据
     * @return
     */
    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
}
